<?php
class Actor
{
 public $package = array();
 public $hp = 100;
 public $mp = 100;

 public function run(){
	 e("act run");
 }
 public function pickup($tools){
	 $this->package[] = $tools;
 }
 public function fire($monster){
	 echo"act fire....";
	 $monster->hp = $monster->hp - 10;
	 $monster->fire($this);
 }
 public function use_equ(){
	 e("use....");
 }
 public function be_fire($x){
	 $this->hp = $this->hp-$x;
 }
}

class monster
{
  public $hp = 200;

  public function run(){
    echo "monster run....";
  }
  public function fire($act){
  echo "monster fire.....";
  $act->hp = $act->hp - 5;
   }
}
$act = new Actor;
$monsters = array();
 for($i=0;$i<10;$i++){
   $monster[] = new monster;
}
//向怪物第一次发射攻击
//var_dump($monsters);
for($i=0;$i<100;$i++){
	if($monster[0]->hp<=0){
		echo"monster death";
		break;
	}
 echo"monster hp:".$monster[0]->hp;
 $act->fire($monster[0]);
}

echo"act:".$act->hp;
echo"monster:".$monster[0]->hp;
?>
